<template>
  <div class="content_padding">
    <div class="container" style="position: fixed; top: 0;left: 0;">
      <span class="staffTitle">检定记录详情</span>
      <div class="btn">
        <el-button type="text" icon="icon iconfont iconfanhui" @click="returnPage">返回</el-button>
      </div>
    </div>

    <div class="device_info two-columns">
      <div class="title">设备基本信息</div>
      <div class="basic_info" style="margin-top: 10px;">
        <!-- 左侧信息 -->
        <div class="left-column">
          <div class="info_box">
            <span class="txt">设备类型：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ formData.deviceTypeName }}</span>
          </div>
          <div class="info_box">
            <span class="txt">设备规格：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ formData.model }}</span>
          </div>
          <div class="info_box">
            <span class="txt">设备来源：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ formData.deviceSource }}</span>
          </div>
        </div>

        <!-- 右侧信息 -->
        <div class="right-column">
          <div class="info_box">
            <span class="txt">地标：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ formData.bidSection }}</span>
          </div>
          <div class="info_box">
            <span class="txt">进场编号：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ formData.mobilizationSerialNumber }}</span>
          </div>
        </div>
      </div>
    </div>
    <div class="wire"></div>

    <div class="device_info two-columns">
      <div class="title">检定记录信息</div>

      <div class="basic_info">
        <!-- 左侧信息 -->
        <div class="left-column">
          <div class="info_box">
            <span class="txt">检定单位：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ form.verificationUnit }}</span>
          </div>
          <div class="info_box">
            <span class="txt">检定结果：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ form.verificationResult }}</span>
          </div>
          <div class="info_box">
            <span class="txt">下次检定日期：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ form.nextVerificationTime }}</span>
          </div>
        </div>

        <!-- 右侧信息 -->
        <div class="right-column">
          <div class="info_box">
            <span class="txt">检定时间：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ form.verificationTime }}</span>
          </div>
          <div class="info_box">
            <span class="txt">证书编码：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ form.certificateCode }}</span>
          </div>
          <div class="info_box">
            <span class="txt">登记人：</span>
            <span class="element_color">&nbsp;</span>
            <span class="text-val">{{ form.registrant }}</span>
          </div>
        </div>
        <div class="upload-pic textarea-wrap">
          <span class="txt">检定意见：</span>
          <span class="textarea">{{ form.opinion }}</span>
        </div>
      </div>
    </div>
    <div class="wire"></div>

    <div class="device_info two-columns">
      <div class="title">检定证书</div>
      <div style="padding: 0 100px 30px 100px; margin-top: 30px;">
        <el-table :data="exitRecord" border size="small" style="width: 100%">
          <el-table-column prop="name" label="文件名称"></el-table-column>
          <el-table-column prop="size" label="文件大小"></el-table-column>
          <el-table-column prop="from" label="创建人"></el-table-column>
          <el-table-column prop="action" label="操作"></el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
import constants from "../../util/constants";

export default {
  components: {},
  data() {
    return {
      formData: {
        bidSection: "",
        deviceSource: "",
        deviceType: "",
        mobilizationSerialNumber: "",
        model: ""
      },
      form: {
        certificateCode: "",
        nextVerificationTime: "",
        opinion: "",
        registrant: "",
        registrationTime: "",
        verificationResult: "",
        verificationTime: "",
        verificationUnit: ""
      },
      exitRecord:[]
    };
  },

  methods: {
    // 返回
    returnPage() {
      this.$parent.$data.showPage = 0;
    },

    // 获取数据详情
    getPointDetailsInfo (data) {
      data.rowData.deviceTypeName = constants.DEVICE_TYPE_LIST[data.rowData.deviceType]
      this.formData = data.rowData;
      this.form = data.row;
    }
  }
};
</script>

<style scoped lang="scss">
  .content_padding{
    padding: 20px;
    box-sizing: border-box;
    margin-top: 20px;

    .device_info{
      margin-top: 30px;

      .upload-pic{
        margin-left: 60px;
        padding: 30px 0 0 60px;
        display: flex;

        span{
          font-size: 14px;
          margin-right: 20px;
          margin-top: 4px;
        }
      }

      &.two-columns{
        .textarea-wrap{
          margin-left: 60px;
          padding: 30px 20px 0 0;

          span{
            margin-right: 0;
            margin-top: 0;
          }

          .txt{
            font-size: 14px;
            width: 130px;
            display: inline-block;
            text-align: right;
          }

          .textarea{
            display: inline-block;
            width: 416px;
            height: 80px;
            margin-left: 20px;
            border-radius: 4px;
            background: #f5f5f5;
            padding: 10px 14px;
            box-sizing: border-box;
          }
        }

        .left-column{
          margin-left: 20px;
        }

        .left-column,
        .right-column{
          width: 48%;
        }
      }

      .title{
        width: 100%;
        font-weight: bold;
        line-height: 50px;
        display: inline-block;
        border-bottom: 1px solid rgb(236, 236, 236);
      }

      .basic_info{
        display: flex;
        flex-wrap: wrap;

        .info_box{
          margin-right: 30px;
          margin-top: 24px;
          display: flex;
          align-items: center;

          &.image-wrap{
            flex-direction: column;
            align-items: normal;

            .pic-wrap{
              margin-left: 185px;
              margin-top: -40px;
              width: 500px;
            }

            .txt{
              line-height: 42px;
            }
          }

          .txt{
            font-size: 14px;
            width: 174px;
            display: inline-block;
            text-align: right;
          }

          .element_color{
            color: #f44336;
            font-size: 12px;
            margin-right: 12px;
          }

          .text-val{
            font-size: 14px;
            color: #333333;
            background: #f5f5f5;
            height: 42px;
            line-height: 42px;
            padding-left: 16px;
            border-radius: 4px;
            display: inline-block;
            width: 400px;
          }

          .input_width{
            height: 42px;
            display: flex;
            align-items: center;
          }
        }
      }
    }
  }

  .wire{
    width: 100%;
    height: 1px;
    background: rgb(236, 236, 236);
    margin-top: 30px;
  }

  .el-button--text >>> .iconfanhui,
  .el-button--text >>> .iconfasongtijiao{
    margin-right: 4px;
    font-size: 18px;
    vertical-align: -2px;
  }
</style>

